package com.hd.appcommon.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hd.appcommon.entity.OpenRecord;
import com.hd.appcommon.entity.vo.OpenRecordVo;
import com.hd.hdxgddcommon.page.MyPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface OpenRecordMapper extends BaseMapper<OpenRecord> {
    @Select("SELECT user_name,door_name,room_name,building_name,face_picture_path,date_format(open_time, '%Y-%m-%d %H:%i:%s') as open_time_string,success FROM open_record ${ew.customSqlSegment}")
    public IPage<OpenRecordVo> getOpenRecordPages(MyPage page, @Param("ew") QueryWrapper<OpenRecord> queryWrapper);
}
